import { createRouter, createWebHistory } from "vue-router";
import BASEURL from "@/router/baseUrl";

const routeArr = [
	{
		path: "/",
		redirect: "/index",
		name: "layout",
		component: () => import("@/layout/Layout.vue"),
		children: [
			{
				path: "index",
				name: "index",

				component: () => import("@/views/index/Index.vue"),
				meta: { title: "首页" }
			},
			{
				path: "vip",
				name: "vip",

				component: () => import("@/views/vip/Vip.vue"),
				meta: { title: "会员" }
			},
			{
				path: "courses",
				name: "courses",

				component: () => import("@/views/courses/Courses.vue"),
				meta: { title: "课程" }
			},
			{
				path: "live",
				name: "live",

				component: () => import("@/views/live/Live.vue"),
				meta: { title: "直播" }
			}
		]
	},
	{
		path: "/demo",
		name: "demo",
		component: () => import("@/views/demo/Demo.vue")
	}
];
const router = createRouter({
	history: createWebHistory(BASEURL),
	routes: routeArr
});
export default router;
